package class_1_4;

public class Dog extends Animal{
    //调用父类的有参构造，若父类中没有无参构造，必须在子类中通过super显示调用父类的有参构造
    public Dog(String name, int age) {
        super(name, age);
    }
    public void eat(String food){
        System.out.println("狗狗"+this.name+"正在吃"+food);
    }
    //静态方法不能重写
    public static void test(){
        System.out.println("Dog's test");
    }
}
